package it.polimi.authentication.ejb.usermanagement;

import it.polimi.authentication.ejb.usermanagement.dto.PacchettoMezzoDTO;

import java.io.Serializable;

import javax.persistence.*;


/**
 * The persistent class for the pacchetto_mezzo database table.
 * 
 */
@Entity
@Table(name="pacchetto_mezzo")
@NamedQueries({
	@NamedQuery(name="PacchettoMezzo.findAll", query="SELECT p FROM PacchettoMezzo p"),
	@NamedQuery(name="PacchettoMezzo.findPacchetto", query="SELECT p FROM PacchettoMezzo p WHERE p.mezzo=:idMezzo"),
	@NamedQuery(name="PacchettoMezzo.findEntityMezzo", query="SELECT m FROM PacchettoMezzo pm , MezzoDiTrasporto m WHERE pm.mezzo=m.mezzo AND pm.id=:idPacchetto"),
	@NamedQuery(name="PacchettoMezzo.findEntityMezzoByCitta", query="SELECT m FROM PacchettoMezzo pm , MezzoDiTrasporto m WHERE pm.mezzo=m.mezzo AND pm.id=:idPacchetto "+"AND m.luogopartenza=:cittaPartenza"),
	@NamedQuery(name="PacchettoMezzo.findEntityMezzoByArrivo", query="SELECT m FROM PacchettoMezzo pm , MezzoDiTrasporto m WHERE pm.mezzo=m.mezzo AND pm.id=:idPacchetto "+"AND m.luogoarrivo=:cittaPartenza"),
	@NamedQuery(name="PacchettoMezzo.findMezzo", query="SELECT p FROM PacchettoMezzo p WHERE p.id=:idPacchetto"),
})
public class PacchettoMezzo implements Serializable {
	private static final long serialVersionUID = 1L;

	
	public PacchettoMezzo(PacchettoMezzoDTO pacMezDTO){
		super();
		this.id=pacMezDTO.getIDPacchetto();
		this.mezzo=pacMezDTO.getMezzoDiTrasporto();
	}
	@Id
	@GeneratedValue(strategy=GenerationType.AUTO)
	private int numRiga;

	private int id;

	private int mezzo;

	public PacchettoMezzo() {
	}

	public int getNumRiga() {
		return this.numRiga;
	}

	public void setNumRiga(int numRiga) {
		this.numRiga = numRiga;
	}

	public int getId() {
		return this.id;
	}

	public void setId(int id) {
		this.id = id;
	}

	public int getMezzo() {
		return this.mezzo;
	}

	public void setMezzo(int mezzo) {
		this.mezzo = mezzo;
	}

}